﻿Class ActorStatusView
    Private parentPanel As ActorsPanel
    Private actor As Receiver
    Private position As Point

    Sub New(ByVal actorPanel As ActorsPanel, ByVal receiver As Receiver, ByVal aPosition As Point)
        parentPanel = actorPanel
        actor = receiver
        position = aPosition
        createNameLabel()
        createStatusLabel()
        createCommandProgressBar()
    End Sub


    Private Sub createNameLabel()
        Dim label = New Label()
        label.Text = actor.getName()
        label.Size = New Size(50, 20)
        label.Location = New Point(position.X, position.Y)
        parentPanel.Controls.Add(label)
    End Sub

    Private Sub createStatusLabel()
        Dim label = New Label()
        label.Text = actor.getStatusDescription()
        label.Size = New Size(100, 20)
        label.Location = New Point(position.X + 50, position.Y)
        parentPanel.Controls.Add(label)
        Dim statusObserver = New LabelStatusObserver(label, actor)
    End Sub

    Private Sub createCommandProgressBar()
        Dim progressBar = New ProgressBar()
        progressBar.Size = New Size(50, 20)
        progressBar.Location = New Point(position.X + 150, position.Y - 3)
        parentPanel.Controls.Add(progressBar)
        Dim progressObserver As ActorCommandStatusObserver = New ActorCommandStatusObserver(progressBar, actor)
    End Sub

End Class
